package com.tl.libpay;

import android.app.Activity;

import com.tl.commonlibrary.ui.BaseFragmentActivity;
import com.tl.libmanager.PayEntrance;
import com.tl.libpay.ui.PayTool;

/**
 * @author JongSung
 * @Description lib.Pay module的入口,跨module调用需要经过此类中的方法
 * @date 2017/7/26 0022
 */

public class LibEntrance implements PayEntrance {
    @Override
    public void payAli(Activity activity, String orderInfo, OnPayResultListener payListener) {
        PayTool payTool = new PayTool((BaseFragmentActivity) activity);
        payTool.setProductId(orderInfo);
        payTool.setResultListener(payListener);
        payTool.onAliPay();
    }

    @Override
    public void payWX(Activity activity, String orderInfo, OnPayResultListener payListener) {
        PayTool payTool = new PayTool((BaseFragmentActivity) activity);
        payTool.setProductId(orderInfo);
        payTool.setResultListener(payListener);
        payTool.onWXPay();
    }
}
